package com.zhuangjie.order.feign;

import com.zhaungjie.base.conduit.TypeR;
import com.zhuangjie.user.entity.AddressBook;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(name = "spark-user")
public interface UserFeignService {


    @ApiOperation("根据id获取当前用户地址信息")
    @GetMapping("/user/address-book/{addressBookId}")
    TypeR<AddressBook> getAddressBookById(@PathVariable("addressBookId") Long addressBookId);


    @GetMapping("/user/user/openId")
    @ApiOperation("内部接口-获取用户tokenId")
    TypeR<String> getUserOpenId(@RequestParam("userId") Long userId);
}
